// api.js数据接口
// import axios from 'axios'
import {request} from '../utils/request'
// import configJs from '../../config'
const md5 = require('md5')

// 登录
export function login (self, query) {
    let mStr = JSON.stringify(query) + query['_createTime']
    let sign = md5(mStr)
    // console.log(mStr)
    return request(self, {
        url: '/frame_login?sign=' + sign,
        headers: { 'requestType': 'json' },
        method: 'post',
        data: query
    })
}

// 登出
export function logout (self, query) {
    // console.log(query)
	return request(self, {
        url: '/frame_logout',
        headers: { 'requestType': 'json' },
        method: 'get'
    })
}

// 取用户信息
export function getUserInfo (self, query) {
    // console.log(query)
	return request(self, {
        url: '/frame_getUserInfo',
        headers: { 'requestType': 'json' },
        method: 'post'
    })
}
